feat(IN-09): decision execution wiring — ClusterManager executes Merge/Split#111
Open
rebelmachina wants to merge 5 commits intomainfrom
Open
feat(IN-09): decision execution wiring — ClusterManager executes Merge/Split#111rebelmachina wants to merge 5 commits intomainfrom
rebelmachina wants to merge 5 commits intomainfrom
Conversation
Replace `allocated_servers: Vec<ServerHandle>` with `servers: HashMap<Uuid, ServerHandle>` (cluster_id key) so execute_merge/split can look up and release servers by cluster_id. Add `SpatialIndex::reassign_cluster(from, to)` — O(n) bulk entity reassignment called during merge execution. Closes #79, closes #80. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ExecutionConfig struct (min_confidence, merge/split cooldown ticks, max_per_cycle) with sensible defaults. Add merge_cooldowns and split_cooldowns hashmaps to ClusterManager. Tick down and prune cooldowns at the start of each evaluation cycle. Closes #81. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add execute_merge(): confidence/cooldown guardrails, SpatialIndex reassign_cluster, pool.release, servers map cleanup, merge cooldown recording. Add execute_split(): confidence/cooldown guardrails, pool.allocate, group_b entity migration via update_entity, split cooldown on both resulting cluster ids. Pool exhaustion is a non-fatal skip. Add tracing dep to arcane-infra for warn! calls. Closes #82, closes #83. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace discarded `let _decisions` with a decision execution loop: bootstrap server allocation now happens before model evaluation; model decisions are applied in priority order up to max_per_cycle per tick; execution errors are logged as warnings and do not abort the cycle. Closes #84. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 7 integration tests: merge execution, split execution, confidence guardrail, merge cooldown, pool exhaustion skip, max_per_cycle cap, cooldown expiry. Fix bootstrap: allocate servers keyed by cluster_id (not server_id) so execute_merge/split can look up the correct handle. Fix cooldown edge case: skip inserting cooldown entry when ticks=0 to avoid blocking same-cycle decisions (would break max_per_cycle=∞ case). Export ExecutionConfig from arcane-infra lib.rs. Closes #85. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopened from #86 (auto-closed when base branch
feat/affinity-enginewas deleted on merge of #77). Rebased cleanly onto main — 5 commits, no conflicts.Closes #78 (epic).
Summary
servers: HashMap<Uuid, ServerHandle>(key = cluster_id) replacing the flatVec<ServerHandle>SpatialIndex::reassign_cluster(from, to)— O(n) bulk entity migration for mergeExecutionConfig+merge_cooldowns/split_cooldownsguardrail state onClusterManagerexecute_merge(): confidence/cooldown guards → reassign → pool.release → cooldown recordexecute_split(): confidence/cooldown guards → pool.allocate → group_b migration → cooldown on both clusters; pool exhaustion is a non-fatal skiplet _decisions = ...with priority-ordered execution loop capped atmax_per_cycleNotable fixes found during implementation
cluster_id(not randomserver_id) so execute_merge/split can look up the correct handle0-tick entry would block same-cycle decisions viacontains_key— guardedTest plan
18 tests pass (11 existing + 7 new).